<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>解决IE6,IE7不能隐藏绝对定位溢出的内容</title>
        <style>
        #wrap {
            width: 1000px;
            height: 500px;
            margin: 0 auto;
            border: 1px solid red;
            position: relative;
            /*添加position: relative;解决IE6,IE7不能隐藏绝对定位溢出的内容*/
            overflow: hidden;
        }
        #box {
            width: 100px;
            height: 30px;
            background: #EEE;
            position: relative;
         }
        #inner{
            width: 50px;
            height: 15px;
            position: absolute;
            left: -10px;
            top: 0px;
            background: red;
            z-index: 12;
        }
        </style>
    </head>
    <body>
        <div id="wrap">
            <div id="box">
                <div id="inner"></div>
            </div>
        </div>
    </body>
</html>